﻿///
/// Test script file NetworkSetupTest.fsx.
/// Test for NetworkSetup.fs
///

#load "Network.fs"
#load "NetworkSetup.fs"

open PathFinder.NetworkSetup

(* Adjacency matrix test *)
printfn "---------------------------------"
printfn "Beginning ajacency matrix test..."
printfn "---------------------------------"
printfn "Creating adjacency matrix..."
let mutable nam = NetworkAdjacencyMatrix ()
printfn "Creating node ids..."
let nodeA = "NodeA"
let nodeB = "NodeB"
let nodeC = "NodeC"
let nodeD = "NodeD"
let nodeE = "NodeE"
let nodeF = "NodeF"
printfn "We have: %s %s %s %s %s %s" nodeA nodeB nodeC nodeD nodeE nodeF
printfn "Adding adjacencies..."
AddAdjacency (nam, (nodeA, nodeB), 2.0)
//AddAdjacency (nam, (nodeA, nodeC), 3.0)
AddAdjacency (nam, (nodeA, nodeD), 2.0)
AddAdjacency (nam, (nodeA, nodeE), 2.0)
AddAdjacency (nam, (nodeA, nodeF), 2.0)
AddAdjacency (nam, (nodeB, nodeA), 4.0)
AddAdjacency (nam, (nodeB, nodeC), 4.0)
//AddAdjacency (nam, (nodeB, nodeD), 5.0)
AddAdjacency (nam, (nodeB, nodeE), 6.0)
AddAdjacency (nam, (nodeB, nodeF), 6.0)
AddAdjacency (nam, (nodeC, nodeA), 2.0)
AddAdjacency (nam, (nodeC, nodeB), 7.0)
//AddAdjacency (nam, (nodeC, nodeD), 9.0)
AddAdjacency (nam, (nodeC, nodeE), 7.0)
AddAdjacency (nam, (nodeC, nodeF), 7.0)
AddAdjacency (nam, (nodeD, nodeA), 1.0)
AddAdjacency (nam, (nodeD, nodeB), 3.0)
AddAdjacency (nam, (nodeD, nodeC), 8.0)
AddAdjacency (nam, (nodeD, nodeE), 8.0)
AddAdjacency (nam, (nodeD, nodeF), 8.0)
printfn "%s" (PrintAdjacencyMatrix (nam))
printfn "Normalizing matrix..."
nam <- NormalizeAdjacencyMatrix (nam)
printfn "%s" (PrintAdjacencyMatrix (nam))
